package com.hwadee.service.impl;

import com.hwadee.mapper.DeviceMapper;
import com.hwadee.pojo.Device;
import com.hwadee.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeviceServiceImpl implements DeviceService {

    @Autowired
    private DeviceMapper deviceMapper;
    //条件查询设备列表
    @Override
    public List<Device> searchDevice(String username, String sn) {
        return deviceMapper.searchDevice(username, sn);
    }
    //根据设备 ID 删除设备记录
    @Override
    public void deleteById(Integer id) {
        deviceMapper.deleteById(id);
    }
    //更新设备信息
    @Override
    public void update(Device device) {
        deviceMapper.update(device);
    }
    //插入新设备记录
    @Override
    public void insert(Device device) {
        deviceMapper.insert(device);
    }
}

